package com.example.friend.controller;

import com.example.friend.service.impl.IUserServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 测试邮件发送
 *
 * @author qzz
 */
@RestController
@RequestMapping("/mail")
@Slf4j
public class TestController {

    @Autowired
    private IUserServiceImpl mailService;


    /**
     * 发送文本邮件
     *
     * @param to
     * @param subject
     * @param text
     */
    @RequestMapping("/sendTextMail")
    public void sendTextMail(String to, String subject, String text) {
        log.info("{},{},{}", to, subject, text);
        mailService.sendTextMailMessage(to, subject, text);
    }
}

